﻿@using Kovan.Model.Entity.Config;
@{
    var item = Model as tb_link;
}
<div class="pageContent">
    <form method="post" action="@Url.Content("~/Manage/Link/SaveLink")" class="pageForm required-validate"
    onsubmit="return LinkManage.SaveLink(this, LinkManage.dialogAjaxDone);">
    <div class="pageFormContent" layouth="56">
        <p>
            <label>
                链接标题：</label>
            <input type="text" name="title" size="30" value="@item.title" />
            <input type="hidden" name="link_id" value="@item.link_id" />
            <input type="hidden" name="application_id" value="@item.application_id" />
        </p>
        <p>
            <label>
                链接地址：</label>
            <input type="text" name="url" size="30"  value="@item.url" />
        </p>
        <p>
            <label>
                链接方式：</label>
            <select name="link_target">
                <option value="_blank" @(item.link_target == "_blank" ? "selected" : "")>_blank</option>
                <option value="_parent" @(item.link_target == "_parent" ? "selected" : "")>_parent</option>
                <option value="_search" @(item.link_target == "_search" ? "selected" : "")>_search</option>
                <option value="_self" @(item.link_target == "_self" ? "selected" : "")>_self</option>
                <option value="_top" @(item.link_target == "_top" ? "selected" : "")>_top</option>
            </select>
        </p>
        @*<p>
            <label>
                图标地址：</label>
            <input type="text" name="img_path" size="30"  value="@item.img_path" />
        </p>*@
        <p>
            <label>
                排序：</label>
            <input type="text" name="sort_order" size="30"  value="@item.sort_order" />
        </p>
        <p>
            <label>
                首页可见：</label>
            <input type="checkbox" name="is_index" value="1" @(item.is_index == 0 ? "" : "checked") />
        </p>
        <p>
            <label>
                可见：</label>
            <input type="checkbox" name="is_view" value="1" @(item.is_view == 0 ? "" : "checked") />
        </p>
        <div class="divider">
        </div>
        <dl class="nowrap" style="width: 98%">
            <dt>标题图片：</dt>
            <dd>
                <div id="link_imgbox" class="img_box">
                    <div>
                        <img id="link_titlePic" width="140" height="130" src="@((string.IsNullOrEmpty(item.img_path) || item.img_path == "folder.gif") ? Url.Content("~/content/images/folder.gif") : Url.Content("~/content/uploads/Link/" + item.img_path))" default="@Url.Content("~/content/images/folder.gif")" />
                        <input type="hidden" name="img_path" value="@item.img_path" />
                    </div>
                    <div style="margin-top: 5px;">
                        <span><a href="@Url.Content("~/Manage/Link/UploadDialog")" target="dialog" rel="news_upload" width="400" height="150"  title="上传链接图片" mask="true">
                            上传</a></span><span><a href="javascript:;" onclick="LinkManage.DeletePic();">删除</a></span>
                    </div>
                </div>
            </dd>
        </dl>
        <dl class="nowrap" style="width: 98%">
            <dt>描述：</dt>
            <dd>
                <textarea name="description" cols="77" rows="5">@item.description</textarea></dd>
        </dl>
    </div>
    <div class="formBar">
        <ul>
            <!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="submit">
                            保存</button></div>
                </div>
            </li>
            <li>
                <div class="button">
                    <div class="buttonContent">
                        <button type="button" class="close">
                            取消</button></div>
                </div>
            </li>
        </ul>
    </div>
    </form>
</div>
